package com.zlm.website.service.service;

import com.zlm.common.base.BaseService;
import com.zlm.common.base.PageEntity;
import com.zlm.website.service.entity.WebsiteNewsDO;

import java.util.List;
import java.util.Map;

/**
 * website_news官网新闻Service
 *
 * @Author: duyufu
 * @Date: 2019/3/14 14:35
 */
public interface WebsiteNewsService extends BaseService<WebsiteNewsDO> {

    /**
     * 根据类型获取任意类型新闻
     *
     * @param newsType
     * @return
     */
    List<WebsiteNewsDO> getEntityByType(Integer newsType);

    /**
     * 分页查询新闻
     *
     * @param map
     * @return
     */
    List<WebsiteNewsDO> getNewsList(Map<String, Object> map);

    /**
     * 获取同一类型新闻数量，type为空获取所有新闻
     *
     * @param newsType
     * @return
     */
    int countWebsiteNews(Integer newsType);

    /**
     * 根据主键获取新闻实体
     * @param id
     * @return
     */
    WebsiteNewsDO getEntityById(Integer id);

    /**
     * 分页查询新闻
     * @param newsType
     * @param pageNumber
     * @param pageSize
     * @return
     */
    PageEntity queryAllWebsiteNews(Integer newsType, Integer pageNumber, Integer pageSize);

    /**
     * 添加官网新闻
     * @param news
     */
    boolean insertWebsiteNews(WebsiteNewsDO news);

    /**
     * 获取官网轮播新闻
     * @return
     */
    List<WebsiteNewsDO> getWebsiteNews();
}
